package com.ruoyi.point.service.impl;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

import cn.hutool.core.date.LocalDateTimeUtil;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.point.mapper.OperationLogMapper;
import com.ruoyi.point.pojo.OperationLog;
import com.ruoyi.point.service.IOperationLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 操作日志管理Service业务层处理
 *
 * @author ruoyi
 * @date 2024-04-29
 */
@Service
public class OperationLogServiceImpl implements IOperationLogService
{
    @Autowired
    private OperationLogMapper operationLogMapper;

    /**
     * 查询操作日志管理
     *
     * @param createTime 操作日志管理主键
     * @return 操作日志管理
     */
    @Override
    public OperationLog selectOperationLogByCreateTime(Date createTime)
    {
        return operationLogMapper.selectOperationLogByCreateTime(createTime);
    }

    /**
     * 查询操作日志管理列表
     *
     * @param operationLog 操作日志管理
     * @return 操作日志管理
     */
    @Override
    public List<OperationLog> selectOperationLogList(OperationLog operationLog)
    {
        return operationLogMapper.selectOperationLogList(operationLog);
    }

    /**
     * 新增操作日志管理
     *
     * @param operationLog 操作日志管理
     * @return 结果
     */
    @Override
    public int insertOperationLog(OperationLog operationLog)
    {
        operationLog.setCreateTime(LocalDateTime.now());
        return operationLogMapper.insertOperationLog(operationLog);
    }

    /**
     * 修改操作日志管理
     *
     * @param operationLog 操作日志管理
     * @return 结果
     */
    @Override
    public int updateOperationLog(OperationLog operationLog)
    {
        return operationLogMapper.updateOperationLog(operationLog);
    }

    /**
     * 批量删除操作日志管理
     *
     * @param createTimes 需要删除的操作日志管理主键
     * @return 结果
     */
    @Override
    public int deleteOperationLogByCreateTimes(Date[] createTimes)
    {
        return operationLogMapper.deleteOperationLogByCreateTimes(createTimes);
    }

    /**
     * 删除操作日志管理信息
     *
     * @param createTime 操作日志管理主键
     * @return 结果
     */
    @Override
    public int deleteOperationLogByCreateTime(Date createTime)
    {
        return operationLogMapper.deleteOperationLogByCreateTime(createTime);
    }
}
